import request from '@/utils/request'

// 获取课程分类列表
export function categoryList(data) {
  return request({
    url: '/course/category/list',
    method: 'post',
    data
  })
}
// 上传缩略图
export function uploadImg(data) {
  return request({
    url: '/upload/uploadFile',
    method: 'post',
    data
  })
}
// 添加课程分类
export function addCategory(data, headers) {
  return request({
    url: '/course/category/addnew',
    method: 'post',
    data,
    headers
  })
}
// 获取课程分类
export function getcategoryById(data) {
  return request({
    url: '/course/category/get',
    method: 'get',
    params: data
  })
}
// 修改课程分类
export function updateCategory(data, headers) {
  return request({
    url: '/course/category/update',
    method: 'post',
    data,
    headers
  })
}
// 删除课程分类
export function deleteCategory(id, headers) {
  return request({
    url: '/course/category/delete',
    method: 'get',
    params: { id },
    headers
  })
}
